﻿// LightNet - Lightweight .NET Framework
// Copyright (c) 2010 http://lightnet.codeplex.com

namespace System.Runtime.InteropServices
{
    /// <summary>
    /// Controls accessibility of an individual managed type or member, or of all types within an assembly, to COM.
    /// </summary>
    [ComVisible(true)]
    [AttributeUsage(AttributeTargets.Delegate | AttributeTargets.Interface | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Assembly, Inherited = false)]
    public sealed class ComVisibleAttribute : Attribute
    {
        /// <summary>
        /// Gets a value that indicates whether the COM type is visible.
        /// </summary>
        /// <returns>true if the type is visible; otherwise, false. The default value is true.</returns>
        public bool Value { get; internal set; }

        /// <summary>
        /// Initializes a new instance of the ComVisibleAttribute class.
        /// </summary>
        /// <param name="visibility">true to indicate that the type is visible to COM; otherwise, false. The default is true.</param>
        public ComVisibleAttribute(bool visibility)
        {
            Value = visibility;
        }
    } 

}
